#! /bin/bash
source ./env.sh
download_k8e() {

    echo "Finding latest version from GitHub"
    version=$(curl -s https://api.github.com/repos/$OWNER/$REPO/releases/latest | jq -r .tag_name)
    echo $version

    # systemctl stop k8e.service
    # rm -rf /usr/local/bin/k8e

    wget https://ghproxy.net/https://github.com/$OWNER/$REPO/releases/download/$version/$SYSTEM_NAME
    $SUDO chmod +x $SYSTEM_NAME
    # $SUDO mv $SYSTEM_NAME $BIN_DIR
    # echo "copy sucess!!!"
}
download_k8e
